<?php
/**
 * +-------------------------------------------------------------
 * |Caption:
 * +-------------------------------------------------------------
 * |Author: Lenny
 * +-------------------------------------------------------------
 * |Email:  1685964109@qq.com
 * +-------------------------------------------------------------
 * |Date:   2024/6/18 下午12:33
 * +-------------------------------------------------------------
 */

namespace app\admin\model;

use app\common\model\BaseModel;

class SysAuthMenu extends BaseModel
{
    /**
     * 关联菜单节点表
     * @param $authId
     * @return array
     */
    public function getAuthMenuList($authId): array
    {
        return $this->whereIn('auth_id', $authId)
                    ->column('menu_id');
    }

    /**
     * 删除历史权限节点
     * @param $authId
     * @return bool
     */
    public function delHistoryAuthNode($authId): bool
    {
        return $this->where('auth_id', $authId)->delete();
    }
}